package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kmproject.haifu.R;
import com.kmproject.haifu.mvp.model.entity.beans.HouseMainBean;

import java.util.List;

public class HouseRentingShowMainAdapter extends BaseQuickAdapter<HouseMainBean,BaseViewHolder> {
    public HouseRentingShowMainAdapter(@Nullable List<HouseMainBean> data) {
        super(R.layout.houserenting_main_item,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HouseMainBean item) {
       helper.<TextView>getView(R.id.houserenting_main_item_tv).setText(item.getTitle());
       helper.<RecyclerView>getView(R.id.houserenting_main_item_RecyclerView).setLayoutManager(new GridLayoutManager(mContext,4));
       helper.<RecyclerView>getView(R.id.houserenting_main_item_RecyclerView).setAdapter(new HouseRentingShowMainItemAdapter(item.getHouseMainItems()));

    }
}
